﻿<?xml version="1.0" encoding="utf-8"?>
<Schema Namespace="Хранилище VinidiktovDEMnovemberModel" Provider="System.Data.SqlClient" ProviderManifestToken="2012" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
  <EntityType Name="City">
    <Key>
      <PropertyRef Name="ID_City" />
    </Key>
    <Property Name="ID_City" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
    <Property Name="Title" Type="nvarchar" MaxLength="100" Nullable="false" />
  </EntityType>
  <EntityType Name="Client">
    <Key>
      <PropertyRef Name="ID_Client" />
    </Key>
    <Property Name="ID_Client" Type="int" Nullable="false" />
    <Property Name="Surname" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="Name" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="ForeName" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="Series" Type="int" Nullable="false" />
    <Property Name="Number" Type="int" Nullable="false" />
    <Property Name="DataOfBirthday" Type="date" Nullable="false" />
    <Property Name="Index" Type="int" Nullable="false" />
    <Property Name="ID_City" Type="int" Nullable="false" />
    <Property Name="ID_Street" Type="int" Nullable="false" />
    <Property Name="Home" Type="int" Nullable="false" />
    <Property Name="Flat" Type="int" Nullable="false" />
    <Property Name="E-mail" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="Password" Type="nvarchar" MaxLength="50" Nullable="false" />
  </EntityType>
  <EntityType Name="Employee">
    <Key>
      <PropertyRef Name="ID_Employee" />
    </Key>
    <Property Name="ID_Employee" Type="int" Nullable="false" />
    <Property Name="ID_Post" Type="int" Nullable="false" />
    <Property Name="Surname" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="Name" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="Forename" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="Login" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="Password" Type="nvarchar" MaxLength="50" Nullable="false" />
  </EntityType>
  <EntityType Name="History_Employee">
    <Key>
      <PropertyRef Name="ID_History" />
    </Key>
    <Property Name="ID_Employee" Type="int" Nullable="false" />
    <Property Name="Date" Type="datetime" />
    <Property Name="ID_Input" Type="int" Nullable="false" />
    <Property Name="ID_History" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  </EntityType>
  <EntityType Name="Order">
    <Key>
      <PropertyRef Name="ID_Order" />
    </Key>
    <Property Name="ID_Order" Type="int" Nullable="false" />
    <Property Name="DateCreation" Type="date" Nullable="false" />
    <Property Name="OrderTime" Type="time" Precision="7" Nullable="false" />
    <Property Name="ID_Client" Type="int" Nullable="false" />
    <Property Name="Status" Type="int" Nullable="false" />
    <Property Name="ClosingDate" Type="date" />
    <Property Name="RentalTime" Type="int" Nullable="false" />
  </EntityType>
  <EntityType Name="Post">
    <Key>
      <PropertyRef Name="ID_Post" />
    </Key>
    <Property Name="ID_Post" Type="int" Nullable="false" />
    <Property Name="Name" Type="nvarchar" MaxLength="50" Nullable="false" />
  </EntityType>
  <EntityType Name="Service">
    <Key>
      <PropertyRef Name="ID_Service" />
    </Key>
    <Property Name="ID_Service" Type="int" Nullable="false" />
    <Property Name="Name" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="ServiceCode" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="Cost" Type="money" Nullable="false" />
  </EntityType>
  <EntityType Name="ServiceandOrder">
    <Key>
      <PropertyRef Name="ID" />
    </Key>
    <Property Name="ID_Order" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="DateCreate" Type="date" Nullable="false" />
    <Property Name="ID_Client" Type="int" Nullable="false" />
    <Property Name="ID_Service" Type="int" />
    <Property Name="NumberOrder" Type="int" Nullable="false" />
    <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  </EntityType>
  <EntityType Name="Status">
    <Key>
      <PropertyRef Name="ID_Status" />
    </Key>
    <Property Name="ID_Status" Type="int" Nullable="false" />
    <Property Name="Name" Type="nvarchar" MaxLength="50" Nullable="false" />
  </EntityType>
  <EntityType Name="Street">
    <Key>
      <PropertyRef Name="ID_Street" />
    </Key>
    <Property Name="ID_Street" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
    <Property Name="Name" Type="nvarchar" MaxLength="50" Nullable="false" />
  </EntityType>
  <EntityType Name="sysdiagrams">
    <Key>
      <PropertyRef Name="diagram_id" />
    </Key>
    <Property Name="name" Type="nvarchar" MaxLength="128" Nullable="false" />
    <Property Name="principal_id" Type="int" Nullable="false" />
    <Property Name="diagram_id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
    <Property Name="version" Type="int" />
    <Property Name="definition" Type="varbinary(max)" />
  </EntityType>
  <EntityType Name="Type_input">
    <Key>
      <PropertyRef Name="ID_Input" />
    </Key>
    <Property Name="ID_Input" Type="int" Nullable="false" />
    <Property Name="Name" Type="nvarchar" MaxLength="50" Nullable="false" />
  </EntityType>
  <!--Ошибки, обнаруженные при создании:
предупреждение 6002: В таблице или представлении "VinidiktovDEMnovember.dbo.ViewingClient" не определен первичный ключ. Ключ был выведен, а определение таблицы или представления было создано в режиме только для чтения.-->
  <EntityType Name="ViewingClient">
    <Key>
      <PropertyRef Name="ID_Client" />
      <PropertyRef Name="Client" />
      <PropertyRef Name="Series" />
      <PropertyRef Name="Number" />
      <PropertyRef Name="DataOfBirthday" />
      <PropertyRef Name="Index" />
      <PropertyRef Name="Title" />
      <PropertyRef Name="Street" />
      <PropertyRef Name="Home" />
      <PropertyRef Name="Flat" />
      <PropertyRef Name="Email" />
      <PropertyRef Name="Password" />
    </Key>
    <Property Name="ID_Client" Type="int" Nullable="false" />
    <Property Name="Client" Type="nvarchar" MaxLength="152" Nullable="false" />
    <Property Name="Series" Type="int" Nullable="false" />
    <Property Name="Number" Type="int" Nullable="false" />
    <Property Name="DataOfBirthday" Type="date" Nullable="false" />
    <Property Name="Index" Type="int" Nullable="false" />
    <Property Name="Title" Type="nvarchar" MaxLength="100" Nullable="false" />
    <Property Name="Street" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="Home" Type="int" Nullable="false" />
    <Property Name="Flat" Type="int" Nullable="false" />
    <Property Name="Email" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="Password" Type="nvarchar" MaxLength="50" Nullable="false" />
  </EntityType>
  <!--Ошибки, обнаруженные при создании:
предупреждение 6002: В таблице или представлении "VinidiktovDEMnovember.dbo.ViewingEmployee" не определен первичный ключ. Ключ был выведен, а определение таблицы или представления было создано в режиме только для чтения.-->
  <EntityType Name="ViewingEmployee">
    <Key>
      <PropertyRef Name="Employee" />
      <PropertyRef Name="Login" />
      <PropertyRef Name="ID_History" />
      <PropertyRef Name="ID_Employee" />
      <PropertyRef Name="Input" />
    </Key>
    <Property Name="Employee" Type="nvarchar" MaxLength="152" Nullable="false" />
    <Property Name="Login" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="ID_History" Type="int" Nullable="false" />
    <Property Name="Date" Type="datetime" />
    <Property Name="ID_Employee" Type="int" Nullable="false" />
    <Property Name="Input" Type="nvarchar" MaxLength="50" Nullable="false" />
  </EntityType>
  <!--Ошибки, обнаруженные при создании:
предупреждение 6002: В таблице или представлении "VinidiktovDEMnovember.dbo.ViewingOrders" не определен первичный ключ. Ключ был выведен, а определение таблицы или представления было создано в режиме только для чтения.-->
  <EntityType Name="ViewingOrders">
    <Key>
      <PropertyRef Name="ID_Client" />
      <PropertyRef Name="Client" />
      <PropertyRef Name="Service" />
      <PropertyRef Name="City" />
      <PropertyRef Name="DateCreation" />
      <PropertyRef Name="OrderTime" />
      <PropertyRef Name="RentalTime" />
      <PropertyRef Name="Status" />
      <PropertyRef Name="ID_Street" />
      <PropertyRef Name="Cost" />
    </Key>
    <Property Name="ID_Client" Type="int" Nullable="false" />
    <Property Name="Client" Type="nvarchar" MaxLength="152" Nullable="false" />
    <Property Name="Service" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="City" Type="nvarchar" MaxLength="100" Nullable="false" />
    <Property Name="DateCreation" Type="date" Nullable="false" />
    <Property Name="OrderTime" Type="time" Precision="7" Nullable="false" />
    <Property Name="ClosingDate" Type="date" />
    <Property Name="RentalTime" Type="int" Nullable="false" />
    <Property Name="Status" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="ID_Street" Type="int" Nullable="false" />
    <Property Name="Cost" Type="money" Nullable="false" />
  </EntityType>
  <Association Name="FK_Client_City">
    <End Role="City" Type="Self.City" Multiplicity="1" />
    <End Role="Client" Type="Self.Client" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="City">
        <PropertyRef Name="ID_City" />
      </Principal>
      <Dependent Role="Client">
        <PropertyRef Name="ID_City" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Client_Street">
    <End Role="Street" Type="Self.Street" Multiplicity="1" />
    <End Role="Client" Type="Self.Client" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Street">
        <PropertyRef Name="ID_Street" />
      </Principal>
      <Dependent Role="Client">
        <PropertyRef Name="ID_Street" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Employee_Post">
    <End Role="Post" Type="Self.Post" Multiplicity="1" />
    <End Role="Employee" Type="Self.Employee" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Post">
        <PropertyRef Name="ID_Post" />
      </Principal>
      <Dependent Role="Employee">
        <PropertyRef Name="ID_Post" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_History_Employee_Employee">
    <End Role="Employee" Type="Self.Employee" Multiplicity="1" />
    <End Role="History_Employee" Type="Self.History_Employee" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Employee">
        <PropertyRef Name="ID_Employee" />
      </Principal>
      <Dependent Role="History_Employee">
        <PropertyRef Name="ID_Employee" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_History_Employee_Type_input">
    <End Role="Type_input" Type="Self.Type_input" Multiplicity="1" />
    <End Role="History_Employee" Type="Self.History_Employee" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Type_input">
        <PropertyRef Name="ID_Input" />
      </Principal>
      <Dependent Role="History_Employee">
        <PropertyRef Name="ID_Input" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Order_Client">
    <End Role="Client" Type="Self.Client" Multiplicity="1" />
    <End Role="Order" Type="Self.Order" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Client">
        <PropertyRef Name="ID_Client" />
      </Principal>
      <Dependent Role="Order">
        <PropertyRef Name="ID_Client" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Order_Status">
    <End Role="Status" Type="Self.Status" Multiplicity="1" />
    <End Role="Order" Type="Self.Order" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Status">
        <PropertyRef Name="ID_Status" />
      </Principal>
      <Dependent Role="Order">
        <PropertyRef Name="Status" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_ServiceandOrder_Client">
    <End Role="Client" Type="Self.Client" Multiplicity="1" />
    <End Role="ServiceandOrder" Type="Self.ServiceandOrder" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Client">
        <PropertyRef Name="ID_Client" />
      </Principal>
      <Dependent Role="ServiceandOrder">
        <PropertyRef Name="ID_Client" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_ServiceandOrder_Order">
    <End Role="Order" Type="Self.Order" Multiplicity="1" />
    <End Role="ServiceandOrder" Type="Self.ServiceandOrder" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Order">
        <PropertyRef Name="ID_Order" />
      </Principal>
      <Dependent Role="ServiceandOrder">
        <PropertyRef Name="NumberOrder" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_ServiceandOrder_Service">
    <End Role="Service" Type="Self.Service" Multiplicity="0..1" />
    <End Role="ServiceandOrder" Type="Self.ServiceandOrder" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Service">
        <PropertyRef Name="ID_Service" />
      </Principal>
      <Dependent Role="ServiceandOrder">
        <PropertyRef Name="ID_Service" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <EntityContainer Name="Хранилище VinidiktovDEMnovemberModelContainer">
    <EntitySet Name="City" EntityType="Self.City" Schema="dbo" store:Type="Tables" />
    <EntitySet Name="Client" EntityType="Self.Client" Schema="dbo" store:Type="Tables" />
    <EntitySet Name="Employee" EntityType="Self.Employee" Schema="dbo" store:Type="Tables" />
    <EntitySet Name="History_Employee" EntityType="Self.History_Employee" Schema="dbo" store:Type="Tables" />
    <EntitySet Name="Order" EntityType="Self.Order" Schema="dbo" store:Type="Tables" />
    <EntitySet Name="Post" EntityType="Self.Post" Schema="dbo" store:Type="Tables" />
    <EntitySet Name="Service" EntityType="Self.Service" Schema="dbo" store:Type="Tables" />
    <EntitySet Name="ServiceandOrder" EntityType="Self.ServiceandOrder" Schema="dbo" store:Type="Tables" />
    <EntitySet Name="Status" EntityType="Self.Status" Schema="dbo" store:Type="Tables" />
    <EntitySet Name="Street" EntityType="Self.Street" Schema="dbo" store:Type="Tables" />
    <EntitySet Name="sysdiagrams" EntityType="Self.sysdiagrams" Schema="dbo" store:Type="Tables" />
    <EntitySet Name="Type_input" EntityType="Self.Type_input" Schema="dbo" store:Type="Tables" />
    <EntitySet Name="ViewingClient" EntityType="Self.ViewingClient" store:Type="Views" store:Schema="dbo">
      <DefiningQuery>SELECT 
    [ViewingClient].[ID_Client] AS [ID_Client], 
    [ViewingClient].[Client] AS [Client], 
    [ViewingClient].[Series] AS [Series], 
    [ViewingClient].[Number] AS [Number], 
    [ViewingClient].[DataOfBirthday] AS [DataOfBirthday], 
    [ViewingClient].[Index] AS [Index], 
    [ViewingClient].[Title] AS [Title], 
    [ViewingClient].[Street] AS [Street], 
    [ViewingClient].[Home] AS [Home], 
    [ViewingClient].[Flat] AS [Flat], 
    [ViewingClient].[Email] AS [Email], 
    [ViewingClient].[Password] AS [Password]
    FROM [dbo].[ViewingClient] AS [ViewingClient]</DefiningQuery>
    </EntitySet>
    <EntitySet Name="ViewingEmployee" EntityType="Self.ViewingEmployee" store:Type="Views" store:Schema="dbo">
      <DefiningQuery>SELECT 
    [ViewingEmployee].[Employee] AS [Employee], 
    [ViewingEmployee].[Login] AS [Login], 
    [ViewingEmployee].[ID_History] AS [ID_History], 
    [ViewingEmployee].[Date] AS [Date], 
    [ViewingEmployee].[ID_Employee] AS [ID_Employee], 
    [ViewingEmployee].[Input] AS [Input]
    FROM [dbo].[ViewingEmployee] AS [ViewingEmployee]</DefiningQuery>
    </EntitySet>
    <EntitySet Name="ViewingOrders" EntityType="Self.ViewingOrders" store:Type="Views" store:Schema="dbo">
      <DefiningQuery>SELECT 
    [ViewingOrders].[ID_Client] AS [ID_Client], 
    [ViewingOrders].[Client] AS [Client], 
    [ViewingOrders].[Service] AS [Service], 
    [ViewingOrders].[City] AS [City], 
    [ViewingOrders].[DateCreation] AS [DateCreation], 
    [ViewingOrders].[OrderTime] AS [OrderTime], 
    [ViewingOrders].[ClosingDate] AS [ClosingDate], 
    [ViewingOrders].[RentalTime] AS [RentalTime], 
    [ViewingOrders].[Status] AS [Status], 
    [ViewingOrders].[ID_Street] AS [ID_Street], 
    [ViewingOrders].[Cost] AS [Cost]
    FROM [dbo].[ViewingOrders] AS [ViewingOrders]</DefiningQuery>
    </EntitySet>
    <AssociationSet Name="FK_Client_City" Association="Self.FK_Client_City">
      <End Role="City" EntitySet="City" />
      <End Role="Client" EntitySet="Client" />
    </AssociationSet>
    <AssociationSet Name="FK_Client_Street" Association="Self.FK_Client_Street">
      <End Role="Street" EntitySet="Street" />
      <End Role="Client" EntitySet="Client" />
    </AssociationSet>
    <AssociationSet Name="FK_Employee_Post" Association="Self.FK_Employee_Post">
      <End Role="Post" EntitySet="Post" />
      <End Role="Employee" EntitySet="Employee" />
    </AssociationSet>
    <AssociationSet Name="FK_History_Employee_Employee" Association="Self.FK_History_Employee_Employee">
      <End Role="Employee" EntitySet="Employee" />
      <End Role="History_Employee" EntitySet="History_Employee" />
    </AssociationSet>
    <AssociationSet Name="FK_History_Employee_Type_input" Association="Self.FK_History_Employee_Type_input">
      <End Role="Type_input" EntitySet="Type_input" />
      <End Role="History_Employee" EntitySet="History_Employee" />
    </AssociationSet>
    <AssociationSet Name="FK_Order_Client" Association="Self.FK_Order_Client">
      <End Role="Client" EntitySet="Client" />
      <End Role="Order" EntitySet="Order" />
    </AssociationSet>
    <AssociationSet Name="FK_Order_Status" Association="Self.FK_Order_Status">
      <End Role="Status" EntitySet="Status" />
      <End Role="Order" EntitySet="Order" />
    </AssociationSet>
    <AssociationSet Name="FK_ServiceandOrder_Client" Association="Self.FK_ServiceandOrder_Client">
      <End Role="Client" EntitySet="Client" />
      <End Role="ServiceandOrder" EntitySet="ServiceandOrder" />
    </AssociationSet>
    <AssociationSet Name="FK_ServiceandOrder_Order" Association="Self.FK_ServiceandOrder_Order">
      <End Role="Order" EntitySet="Order" />
      <End Role="ServiceandOrder" EntitySet="ServiceandOrder" />
    </AssociationSet>
    <AssociationSet Name="FK_ServiceandOrder_Service" Association="Self.FK_ServiceandOrder_Service">
      <End Role="Service" EntitySet="Service" />
      <End Role="ServiceandOrder" EntitySet="ServiceandOrder" />
    </AssociationSet>
  </EntityContainer>
</Schema>